<?php
// created 6/13/12

class Update_models extends CI_Model{
    
    public function stop_playing_character() {
        
        $user_id = $_SESSION["user"];
        $which_character_id = $this->input->post('whichCharacter');
        
        $character_data = $this->doctrine->em->find('ORM\Dynasties2\Characters', $which_character_id);
        
        $character_data->setPlayerControlled('0');
        $character_data->setLastLoginTurn(NULL);
        $character_data->setUseAi('1');
        
        $this->doctrine->em->flush();
        
    }  // end of function how_many_controlled_characters ///////////////////////////
    //////////////////////////////////////////////////////////////////
    
    
}